{extend name="index/base" /}
{block name='content'}




<!-- 广告位2 -->
<div class="ad_top_box bg-dark">
    <div class="open_show_box">
        {selfTag:multi table="image" where='[["type","=",2],["status","=",1]]' order="sort asc"}
        <a href="{:empty($vo['url'])?'javascript:;':$vo['url']}" class="img_mark_link">
            <img src="{$vo['img']}" alt="{$vo['name']}" class="img_mark"
                style="width: 100%; display: block; height: 100%;">
        </a>
        {/selfTag:multi}

    </div>
</div>
<!--  slider-->
<section class="tns-carousel tns-controls-lg">
    <!-- pc -->
    <div class="tns-carousel-inner small--hide">
        <!-- Item-->
        {selfTag:multi table="image" where='[["type","=",0],["status","=",1]]' order="sort asc"}
        <div class="tns-carousel-item">
            <a href="{:empty($vo['url'])?'javascript:;':$vo['url']}">
                <img class="d-block order-lg-2 me-lg-n5 flex-shrink-0" src="{$vo['img']}" alt="{$vo['name']}" alt="">

            </a>
        </div>
        {/selfTag:multi}

    </div>
    <!-- mobile -->
    <div class="tns-carousel-inner carousel-inner-hide">
        <!-- Item-->
        {selfTag:multi table="image" where='[["type","=",0],["status","=",1]]' order="sort asc"}
        <div class="tns-carousel-item">
            <a href="{:empty($vo['url'])?'javascript:;':$vo['url']}">
                <img class="d-block order-lg-2 me-lg-n5 flex-shrink-0" src="{$vo['img']}" alt="{$vo['name']}" alt="">
            </a>
        </div>
        {/selfTag:multi}

    </div>
</section>

<!-- Products grid (Trending products)-->
<section class="shop-layout-box">
    <div class="container">
        <div class="shop-layout-title text-center">
            <h4>SHOP BY CATEGORY</h4>
        </div>
        <div class="row">
            {selfTag:multi table="platform_tags" where='[["status","=",1],["is_cate","=",1]]' order="sort asc"}
            <div class="col-lg-3 col-md-4 col-sm-6 col-6 mb-4">
                <div class="product">
                    <a class="d-block overflow-hidden" href="/collections?tag_id={$vo['id']}">
                        <div class="img">
                            <img src="{$vo['img']}" alt="Product">
                        </div>
                        <h3 class="product-title">
                            {$vo['name']}
                        </h3>
                    </a>
                </div>
            </div>
            {/selfTag:multi}
        </div>

        <div class="row pt-3">
            <div class="col-md-6 mt-3">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/shop-banner-1.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3">
                            <h5 class="mb-2">TRENDY</h5>
                            <p>Buy 2 get 1 free 50% discount</p>
                        </div>
                    </div>
                </a>
            </div>
            <div class="col-md-6 mt-3">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/shop-banner-2.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3">
                            <h5 class="mb-2">SEXY</h5>
                            <p>Buy 2 get 1 free 50% discount</p>
                        </div>
                    </div>
                </a>
            </div>
            <div class="col-md-12 mt-3">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/shop-banner-3.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3">
                            <h5 class="mb-2">SELL NEW PRODUCTS</h5>
                            <p>Buy 2 get 1 free 50% discount</p>
                        </div>
                    </div>
                </a>
            </div>

        </div>
    </div>
</section>

<section class="shop-layout-box">
    <div class="container">
        <div class="shop-layout-title text-center">
            <h4>NEW PRODUCT LISTING</h4>
        </div>

       <!-- Products grid-->
        <div class="grid-products clearfix">
            <!-- Product-->
            <div class="row mx-n2">
                {selfTag:multi viewModel="\app\common\model\GoodsModel" where='["status"=>1]' order="id desc"}
                    {include file="goods/include_item" /}
                {/selfTag:multi}
            </div>
        </div>

        <div class="text-center">
            <a class="btn btn-view-more"  href="/collections?is_new=1">VIEW MORE</a>
        </div>

        <div class="row pt-3">
            <div class="col-md-12 mt-3">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/shop-banner-4.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3 text-center">
                            <h5 class="mb-2">50% OFF</h5>
                            <p>Buy 2 get 1 free 50% discount</p>
                        </div>
                    </div>
                </a>
            </div>
        </div>
    </div>
</section>

<section class="shop-layout-box">
    <div class="container">
        <div class="row">
            <!-- Product-->
            <div class="col-lg-4 col-md-4 col-sm-6 col-12">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/homeGoods-3.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3 text-center">
                            <h5 class="mb-5">CHILD</h5>
                            <span class="btn btn-view-more" href="">VIEW MORE</span>
                        </div>
                    </div>
                </a>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-6 col-12">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/homeGoods-4.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3 text-center">
                            <h5 class="mb-5">MAN</h5>
                            <span class="btn btn-view-more" href="">VIEW MORE</span>
                        </div>
                    </div>
                </a>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-6 col-12">
                <a class="d-flex shop-banner-row" href="">
                    <img src="/assets/images/homeGoods-5.png" alt="">
                    <div class="shop-banner-cont">
                        <div class="py-4 my-2 my-md-0 py-md-5 px-4 ms-md-3 text-center">
                            <h5 class="mb-5">LADY</h5>
                            <span class="btn btn-view-more" href="">VIEW MORE</span>
                        </div>
                    </div>
                </a>
            </div>
        </div>
    </div>
</section>


<section class="shop-layout-box">
    <div class="container">
        <div class="recommend-header">
            <div class="scroll-area">
                <div class="kind-switch center">
                    <div class="" id="newInDiv" :class="{'active':check_goods_type=='new_in'}" @click="getUpGoods('new_in',{check_type:'new_in'})">New In</div>
                    <div class=""  :class="{'active':check_goods_type=='best_seller'}" @click="getUpGoods('best_seller',{check_type:'new_in'})">Best Seller</div>
                    <div class=""  :class="{'active':check_goods_type=='mens_shirts'}" @click="getUpGoods('mens_shirts',{check_type:'new_in'})">Men's Shirts</div>
                </div>
            </div>
        </div>
        <!-- Products grid-->
        <div class="grid-products clearfix">
            <!-- Product-->
            <div class="row mx-n2">
                <div class="grid-item col-lg-2 col-md-3 col-sm-6 col-6 px-2 mb-4" v-for="(item,index) in up_goods_list" :key="index">
                    <div class="grid-view_item">
                        <div class="grid-view_img">
                            <a class="grid-view-item__link" :href="'/products?id='+item.id">
                                <img class="grid-view-item__image primary " :src="item.cover_img" />
                                <img class="grid-view-item__image hover " :src="item.cover_img_t" />
                            </a>
                            <div class="variants add">
                                <a href="javascript:;" class="btn btn-options quickShop" @click="handleGoodsShowCart(item)">ADD TO BAG</a>
                            </div>
                            <div class="shopWrapper " :class="{'active':item.active_cart}">
                                <div >
                                    <a class="btn closeShop" href="javascript:;" @click="handleGoodsHideCart(item)"><i class="ci-close text-white"></i></a>
                                    <div class="grid product-single">
                                        <div class="productWrap">
                                            <div class="product-form quickshopForm">
                                                <div class="swatch clearfix" v-for="(sku,sku_index) in item.sku_attr" :key="sku_index">
                                                    <div class="product-form__item">
                                                        <label class="header">{{sku.name}}: <span class="slVariant">{{item['sku_group_name']?item['sku_group_name'][sku_index]:''}}</span></label>
                                                        <div class="swatch-element" v-for="(sku_content,sku_content_index) in sku.content" :key="sku_content_index" @click="handleGoodsSkuItem(item,sku_index,sku_content.name)">
                                                            <label class="swatchLbl color " :class="{'checked': item['sku_group_name'] && item['sku_group_name'][sku_index]==sku_content.name}" :title="sku_content.name" v-if="sku_content.img && sku_content.img.length>0" :style="'background-image:url('+sku_content.img+');'">

                                                            </label>
                                                            <label class="swatchLbl size " :class="{'checked': item['sku_group_name'] && item['sku_group_name'][sku_index]==sku_content.name}" :title="sku_content.name" v-else >
                                                                {{sku_content.name}}
                                                            </label>
                                                        </div>

                                                    </div>
                                                </div>
                                                <template v-if="item.sku_price.length>0">
                                                    <button class="btn quickshop-cart" @click="handleGoodsAddCart(item.id,item.sku_select_obj.id)" >
                                                        <span>ADD TO BAG</span>
                                                    </button>

                                                </template>
                                                <template v-else>
                                                    <button class="btn quickshop-cart" >
                                                        <span>ADD TO BAG</span>
                                                    </button>
                                                </template>


                                            </div>


                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <a class="grid-view-item__title text-truncate" :href="'/products?id='+item.id">{{item.name}}</a>

                        <div class="grid-view-item__meta">
                            <span class="shop-price">
                                <strong class="bizhong">{$money_f_name}</strong>
                                <strong class="my_shop_price">{$money_f}{{item.sold_price}}</strong>
                            </span>
                            <del class="market-price" v-show="item.og_price-0 > 0">
                                <strong class="bizhong">{$money_f_name}</strong>
                                <strong class="my_shop_price">{$money_f}{{item.og_price}}</strong>
                            </del>
                            {if(!empty(session('user_info.user_id')))}
                            <span class="like-icon" :style="{backgroundPosition : item.is_coll ? '-104px -65px':'-104px -17px' }" @click="handleGoodsColl(item)"></span>
                            {/if}
                        </div>
                        <ul class="gridSwatches">

                            <li :class="{active:sku_img_index==item.sku_img_index}"  @click="handleSkuImg(item,sku_img,sku_img_index)"  :style="'background-image: url('+sku_img+');'" v-for="(sku_img,sku_img_index) in item.sku_attr_img" :key="sku_img_index"></li>

                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="text-center">
            <a class="btn btn-view-more" :href="'/collections?check_type='+check_goods_type">VIEW MORE</a>
        </div>
    </div>
</section>

<section class="shop-layout-box shop-layout-hide">
    <div class="container">
        <div class="product-area-wrapper brand-wraper">
            <div class="brand-left">
                <a href="/collections?order_field=sold_num&order_sort=desc">
                    <h2>BEST <br> SELLING</h2>
                    <span class="btn btn-view-more" >VIEW MORE</span>
                </a>
            </div>
            <div class="brand-swiper">
                <div class="swiper-container">
                    <div class="swiper-wrapper">
                        {selfTag:multi viewModel="\app\common\model\GoodsModel" where='["status"=>1,"order_field"=>"sold_num","order_sort"=>"desc"]' }
                        <div class="swiper-slide">
                            <div class="slide-box">
                                <div class="product-tips-wrapper">
                                    <!--  <span class="discount-tag notranslate">50% OFF</span>-->
                                    <div class="img-wrapper">
                                        <img src="{$vo['cover_img']}" alt="" class="image">
                                        <img src="{$vo['cover_img_t']}" alt="" class="image hidden">
                                    </div>
                                </div>
                                <div class="information">
                                    <a class="name text-truncate" href="/products?id={$vo['id']}">
                                        {$vo['name']}
                                    </a>

                                    <div class="price">
                                        <span class="special-price">{$money_f}{$vo['price']}</span>
                                        {if(!empty($vo.og_price) && $vo.og_price*1 > 0 ) }
                                        <span class="origin-price">{$money_f}{$vo['og_price']}</span>                                        
                                        {/if}
                                    </div>

                                    <a class="btn" href="/products?id={$vo['id']}">SNAP UP</a>
                                </div>
                            </div>
                        </div>
                        {/selfTag:multi}

                    </div>
                </div>
                <div class="swiper-button-prev"></div>
                <div class="swiper-button-next"></div>
            </div>
        </div>
    </div>
</section>

<section class="shop-layout-box shop-layout-hide">
    <div class="container">
        <div class="shop-layout-title text-center">
            <h4>LOOKBOOK SHOP</h4>
        </div>

        <div class="product-list-row">
            <div class="item  col-4">
                <a href="">
                    <div class="picture">
                        <img src="/assets/images/lookbook-1.png" alt="">
                    </div>
                </a>
            </div>
            <div class="item  col-4">
                <a href="">
                    <div class="picture">
                        <img src="/assets/images/lookbook-2.png" alt="">
                    </div>
                </a>
            </div>
            <div class="item-row  col-4">
                <div class="item">
                    <a href="">
                        <div class="picture">
                            <img src="/assets/images/lookbook-3.png" alt="">
                        </div>
                    </a>
                </div>
                <div class="item">
                    <a href="">
                        <div class="picture">
                            <img src="/assets/images/lookbook-4.png" alt="">
                        </div>
                    </a>
                </div>
            </div>
            <div class="item-row col-4">
                <div class="item">
                    <a href="">
                        <div class="picture">
                            <img src="/assets/images/lookbook-5.png" alt="">
                        </div>
                    </a>
                </div>
                <div class="item">
                    <a href="">
                        <div class="picture">
                            <img src="/assets/images/lookbook-6.png" alt="">
                        </div>
                    </a>
                </div>
            </div>
            <div class="item col-8">
                <a href="">
                    <div class="picture">
                        <img src="/assets/images/lookbook-7.png" alt="">
                    </div>
                </a>
            </div>
        </div>
    </div>
</section>

<section class="shop-layout-box">
    <div class="container">
        <div class="shop-layout-title text-center">
            <h4>SHOP BY GRAPHIC</h4>
            <p>Think of something you love on a t-shirt.</p>
        </div>
        <div class="grid-bar clearfix">
            <!-- <div class="row mx-n2"> -->
                <div class="bar-item">
                    <a href="" class="logo-bar__link">
                        <img class="logo-bar__image " src="/assets/images/funny2_250x150.jpg" />
                    </a>
                </div>
                <div class="bar-item">
                    <a href="" class="logo-bar__link">
                        <img class="logo-bar__image " src="/assets/images/DRINK2_250x150.jpg" />
                    </a>
                </div>
                <div class="bar-item">
                    <a href="" class="logo-bar__link">
                        <img class="logo-bar__image " src="/assets/images/Girl2_250x150.jpg" />
                    </a>
                </div>
                <div class="bar-item">
                    <a href="" class="logo-bar__link">
                        <img class="logo-bar__image " src="/assets/images/FAITH2_250x150.jpg" />
                    </a>
                </div>
                <div class="bar-item">
                    <a href="" class="logo-bar__link">
                        <img class="logo-bar__image " src="/assets/images/FLAG2_250x150.jpg" />
                    </a>
                </div>
            <!-- </div> -->
        </div>
    </div>
</section>


<section class="shop-layout-box">
    <div class="container">
        <div class="shop-layout-title text-center">
            <h4>RECOMMEND FOR YOU</h4>
        </div>

        <!-- Products grid-->
        <div class="grid-products clearfix">
            <!-- Product-->
            <div class="row mx-n2">
                {selfTag:multi viewModel="\app\common\model\GoodsModel" where='["status"=>1,"self_up"=>1]' }
                    {include file="goods/include_item" /}
                {/selfTag:multi}
            </div>
        </div>

    </div>
</section>

<section class="shop-layout-box">
    <div class="container">
        <div class="shop-layout-title text-center">
            <h4>CUSTOM PRODUCTS</h4>
        </div>

        <!-- Products grid-->
        <div class="grid-products clearfix">
            <!-- Product-->
            <div class="row mx-n2">
                {selfTag:multi viewModel="\app\common\model\GoodsModel" where='["status"=>1,"check_goods_type"=>1]' }
                    {include file="goods/include_item" /}
                {/selfTag:multi}
            </div>
        </div>

    </div>
</section>



<section class="shop-layout-box">
    <div class="container">
        <div class="row pb-3">
            <div class="col-md-3 col-sm-6 col-12 mb-4">
                <div class="text-center">
                    <img src="/assets/images/fs-global.png" alt="">
                    <div class="mt-1">
                        <h6 class="fs-base mb-1">Global delivery</h6>
                        <p class="mb-0 fs-ms opacity-50">We can make global delivery
                        </p>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-12 mb-4">
                <div class="text-center">
                    <img src="/assets/images/fs-free.png" alt="">
                    <div class="mt-1">
                        <h6 class="fs-base mb-1">Free return</h6>
                        <p class="mb-0 fs-ms opacity-50">We can make a free return</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-12 mb-4">
                <div class="text-center">
                    <img src="/assets/images/fs-refund.png" alt="">
                    <div class="mt-1">
                        <h6 class="fs-base mb-1">100% Refund</h6>
                        <p class="mb-0 fs-ms opacity-50">We make a 100% refund</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-12 mb-4">
                <div class="text-center">
                    <img src="/assets/images/fs-payment.png" alt="">
                    <div class="mt-1">
                        <h6 class="fs-base mb-1">Safe Payment</h6>
                        <p class="mb-0 fs-ms opacity-50">Our payment is very safe</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

{/block}
{block name='script'}

<!-- Vendor scrits: js libraries and plugins-->
<script src="/assets/js/bootstrap.bundle.min.js"></script>
<script src="/assets/js/smooth-scroll.polyfills.min.js"></script>


<link rel="stylesheet" type="text/css" href="/assets/css/slick.css"/>

<script type="text/javascript" src="/assets/js/slick.min.js"></script>


<script src="/assets/js/swiper.min.js"></script>
<script>
    // $(document).ready(function () {
    //     $('.tns-carousel-inner').slick({
    //         dots: false,
    //         infinite: true,
    //         speed: 500,
    //         fade: true,
    //         cssEase: 'linear'
    //     });
    // });
    function initPageJq(){
        $('.tns-carousel-inner').slick({
            dots: false,
            infinite: true,
            speed: 500,
            fade: true,
            cssEase: 'linear'
        });
        $('.grid-bar').slick({
            infinite: false,
            slidesToShow: 5,
            slidesToScroll: 1,
            responsive: [
                {
                    breakpoint: 1024,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 3,
                    }
                },
                {
                    breakpoint: 768,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 2
                    }
                },
            ]
        });
        var swiper = new Swiper('.recommend-swiper .swiper-container', {
            slidesPerView: 4,
            spaceBetween: 15,
            slidesPerGroup: 4,
            loop: true,
            loopFillGroupWithBlank: true,
            breakpointsInverse: true,
            navigation: {
                nextEl: ".swiper-button-next",
                prevEl: ".swiper-button-prev",
            },
        });

        var swiper = new Swiper('.brand-swiper .swiper-container', {
            slidesPerView: 3,
            spaceBetween: 15,
            slidesPerGroup: 1,
            loop: true,
            loopFillGroupWithBlank: true,
            breakpointsInverse: true,
            navigation: {
                nextEl: ".swiper-button-next",
                prevEl: ".swiper-button-prev",
            },
        });
    }



    layui.extend({
        fileUpload: 'vue-components/fileUpload',
    }).use(["fileUpload"], function (fileUpload) {
        console.log('----222index-')

        initVue({
            data: {
                check_goods_type:'',
                up_goods_list:[],
            },
            components: {
                'file-upload': fileUpload
            },
            computed: {

            },
            created: function () {
                console.log('+++++++created', this.options)
            },
            mounted: function () {
                console.log('+++++++mounted', this.options)
                // this.getUpGoods('new_in')
                //执行第一项
                $("#newInDiv").click()
                this.$nextTick(function(){
                    // setTimeout(function(){
                        initPageJq()
                    // },500)
                })
            },
            methods:{
                getUpGoods:function(check_goods_type,params){
                    if(check_goods_type===this.check_goods_type){
                        return
                    }
                    this.check_goods_type = check_goods_type;
                    var that = this
                    that.up_goods_list  = []
                    this.$network("goods/lists",params).then(function(res){
                        var data = res.data || {}
                        that.up_goods_list = data.list ||[]
                    })
                },
                handleSkuImg:function(item,img,index){
                    item.cover_img =img
                    item.c_cover_img =img
                    this.$set(item,'sku_img_index',index)
                }
            },
        })


    })

</script>
<script>


</script>
{/block}